package com.xiangxiao.rpan.gateway.config;

/**
 * @auther xiangxiao
 * @email 573768011@qq.com
 * @data 2023/2/13 17:50
 */
public class Constants {
  /**
   * 路由信息头
   */
  public static final String ROUTE_X_FORWARDED_PREFIX="x-forwarded-prefix";
  public static final String ROUTE_REQUESTURI="requestURI";
  public static final String ROUTE_SERVICEID="serviceId";


  //=======  返回状态码定义  ========
  /**
   * 映射不存在
   */
  public static final String PATH_NOT_EXIST_CODE = "32000001";
  public static final String PATH_NOT_EXIST_MSG = "请求错误";
  public static final String PATH_NOT_EXIST_RMK = "路由映射信息不存在";

  /**
   * 服务调用异常
   */
  public static final String SERVICE_ERROR_CODE = "32000002";
  public static final String SERVICE_ERROR_MSG = "服务调用异常";

  /**
   * Broken pipe
   */
  public static final String BROKEN_PIPE_ERROR_CODE = "32000003";
  public static final String BROKEN_PIPE_ERROR_MSG = "网络传输出错";

  /**
   * 网关系统异常
   */
  public static final String SYS_ERROR_CODE = "32000004";
  public static final String SYS_ERROR_MSG = "网关系统异常";

  /**
   * 未授权
   */
  public static final String UNAUTHORIZED = "unauthorized";
  /**
   * 禁止
   */
  public static final String PROHIBITED = "prohibited";

  /**
   * 账号不可用
   */
  public static final int ACCOUNT_DISABLED = 0;

  /**
   * 账号不存在
   */
  public static final int ACCOUNT_NOT_EXIST = 1;

  /**
   * 账号已过期
   */
  public static final int ACCOUNT_EXPIRED = 1;
  /**
   * token自动延长有效期间隔key前缀
   */
  public static final String TOKEN_GAP_PREFIX = "rpan-gateway:token_gap:";
}
